/*
 *  Player.cpp
 *  Chronoband C++
 *
 *  Created by Timothy on 8/2/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */

#include "Player.h"
#include <iostream>
using namespace std;
//Default blank constructor
Player::Player(){
	
}

//playerSetup is only run at the beginning of the game
void Player::playerSetup(Player user){
	system("stty raw");
	int raceID;
	int str = 8;
	int dex = 8;
	int con = 8;
	int intell = 8;
	int wis = 8;
	int cha = 8;
	cout<<"\t Please enter your character's Name: ";
	cin>>user.m_Name;
	cout<<"\n\t Of which race is your character?"<<endl<<"\t\t 0: Human"<<endl<<
	"\t\t 1: Elf"<<endl<<"\t\t 2: Dwarf"<<endl<<"\t\t 3: Halfling"<<endl<<
	"\t\t 4: Gnome"<<endl<<"\t\t 5: Half-Orc"<<endl;
	
	switch (raceID){
		case 0:
			Player::playerStatSetup(user, str, dex, con, intell, wis, cha);
			break;
			
		case 1: 
			Player::playerStatSetup(user, str, (dex+2), (con-2), intell, wis, cha);
			break;
			
		case 2:
			Player::playerStatSetup(user, str, dex, (con+2), intell, wis, (cha-2));
			break;
		case 3:
			Player::playerStatSetup(user, (str-2), (dex+2), con, intell, wis, cha);
			break;
		case 4:
			Player::playerStatSetup(user, (str-2), dex, (con+2), intell, wis, cha);
			break;
		case 5:
			Player::playerStatSetup(user, (str+2), dex, con, (intell-2), wis, (cha-2));
			break;
	}
	
}

void Player::playerStatSetup(Player user, int str, int dex, int con, int intell, int wis, int cha){
	user.m_Str = str;
	user.m_Dex = dex;
	user.m_Con = con;
	user.m_Int = intell;
	user.m_Wis = wis;
	user.m_Cha = cha;
}
